//
//  CommunitySelectTableViewCell.m
//  QRMaster
//
//  Created by myApple on 15/6/9.
//  Copyright (c) 2015年 myApple. All rights reserved.
//

#import "CommunitySelectTableViewCell.h"

@interface CommunitySelectTableViewCell()
{
    UILabel * communityNameLabel;
    UIImageView * selectImgView;
}

@end

@implementation CommunitySelectTableViewCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self prepareView];
    }
    return self;
}

-(void)prepareView
{
    float ScreenWidth = [UIScreen mainScreen].bounds.size.width;
    float x = 0;
    float y = 10;
    float width = ScreenWidth;
    float height = 20;
    
    communityNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height)];
    communityNameLabel.font = [UIFont systemFontOfSize:16.0];
    communityNameLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:communityNameLabel];
    
    x = ScreenWidth - 40;
    y = 10;
    width = 20;
    height = 20;
    
    selectImgView = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, width, height)];
    selectImgView.backgroundColor = [UIColor redColor];
    selectImgView.hidden = YES;
    [self.contentView addSubview:selectImgView];
}

-(void)setCommuniname:(NSString *)communiname
{
    _communiname = communiname;
    communityNameLabel.text = communiname;
}

-(void)setCommunityid:(NSString *)communityid
{
    _communityid = communityid;
}

-(void)setRole:(NSString *)role
{
    _role = role;
}

-(void)setSelectCell:(BOOL)selectCell
{
    if (selectCell) {
        selectImgView.hidden = NO;
    }
    else
    {
        selectImgView.hidden = YES;
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
